package com.health.user.model.dto.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用户注册请求体
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */
@Data
public class PatientRegisterRequest implements Serializable {

    @Serial
    private static final long serialVersionUID = 3191241716373120793L;

    @NotBlank
    @Length(min = 5, max = 16,message = "用户账号长度为5~16位")
    @Schema(description = "用户账号", example = "1234567890")
    private String userAccount;

    @NotBlank
    @Length(min = 1, max = 10,message = "用户名长度为1~10位")
    @Schema(description = "用户名", example = "张三")
    private String name;

    @NotBlank
    @Length(min = 8, max = 20,message = "密码长度为8~20位")
    @Schema(description = "密码", example = "12345678")
    private String userPassword;

    @NotNull
    @Min(value = 0,message = "性别只能为0或1")
    @Max(value = 1,message = "性别只能为0或1")
    @Schema(description = "性别", example = "0")
    private Integer gender;

    @NotBlank
    @Length(min = 18, max = 18,message = "身份证长度为18位")
    @Schema(description = "身份证", example = "123456789012345678")
    private String cardId;

    @NotBlank
    @Length(min = 11, max = 11,message = "手机号长度为11位")
    @Schema(description = "手机号", example = "13800138000")
    private String phone;
}
